<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "goods".
 *
 * @property string $goods_id
 * @property string $goods_name
 * @property string $shop_price
 * @property string $marker_price
 * @property string $goods_image
 * @property string $gall_images_id
 * @property string $desc_images_id
 * @property integer $is_new
 * @property integer $is_hot
 * @property integer $is_good
 * @property integer $is_promote
 * @property integer $is_delete
 * @property string $cate_id
 */
class Goods extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'goods';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['goods_id'], 'required'],
            [['shop_price', 'marker_price'], 'number'],
            [['is_new', 'is_hot', 'is_good', 'is_promote', 'is_delete'], 'integer'],
            [['goods_id', 'gall_images_id', 'desc_images_id', 'cate_id'], 'string', 'max' => 40],
            [['goods_name'], 'string', 'max' => 60],
            [['goods_image'], 'string', 'max' => 255],
            [['goods_name'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'goods_id' => Yii::t('app', 'Goods ID'),
            'goods_name' => Yii::t('app', 'Goods Name'),
            'shop_price' => Yii::t('app', 'Shop Price'),
            'marker_price' => Yii::t('app', 'Marker Price'),
            'goods_image' => Yii::t('app', 'Goods Image'),
            'gall_images_id' => Yii::t('app', 'Gall Images ID'),
            'desc_images_id' => Yii::t('app', 'Desc Images ID'),
            'is_new' => Yii::t('app', 'Is New'),
            'is_hot' => Yii::t('app', 'Is Hot'),
            'is_good' => Yii::t('app', 'Is Good'),
            'is_promote' => Yii::t('app', 'Is Promote'),
            'is_delete' => Yii::t('app', 'Is Delete'),
            'cate_id' => Yii::t('app', 'Cate ID'),
        ];
    }

    /**
     * @inheritdoc
     * @return \backend\models\query\GoodsQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new \backend\models\query\GoodsQuery(get_called_class());
    }
}
